package p.lodz.pl.poid.zad2.fourier;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 *
 * @author janiu
 */
public class Main {

    public void performFourier () throws IOException {
        FastBitmap fb = new FastBitmap("images/naruto.jpg");
        fb.toGrayscale();

        FastFourierTransform ft = new FastFourierTransform(fb);
        ft.Forward();
        fb = ft.toFastBitmap();

        FrequencyFilter ff = new FrequencyFilter(0, 60);
        ff.ApplyInPlace(ft);
        fb = ft.toFastBitmap();

        ft.Backward();
        fb = ft.toFastBitmap();
        BufferedImage outImage = fb.toBufferedImage();
        ImageIO.write(outImage, "jpg", new File("outImage.jpg"));
    }
    
}
